package com.poorstu.web;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;

import com.common.base.model.PaginationSupport;
import com.common.base.web.BaseAction;
import com.poorstu.manager.PartTimeManager;
import com.poorstu.manager.StudentManager;
import com.poorstu.model.LoginMod;
import com.poorstu.model.PartTimeMod;
import com.poorstu.model.UserPartTimeMod;

public class PtAuditMagAction extends BaseAction {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		//DynaActionForm dyna=(DynaActionForm)form;
		
		try{
		//StudentManager stu=(StudentManager)getBean("studentManager");
		PartTimeManager ptm=(PartTimeManager)getBean("partTimeManager");
		
		int pageNum = Integer.parseInt(request.getParameter("pageNum"));
		PaginationSupport ps = ptm.searchAllUserPartTimeByPage(pageNum);
		request.setAttribute("upList", ps.getItems());
		request.setAttribute("proPage", ps.getPreviousIndex());
		request.setAttribute("nextPage", ps.getNextIndex());
		request.setAttribute("firstPage", ps.getFirstIndex());
		request.setAttribute("lastPage", ps.getLastIndex());
		
	//List<UserPartTimeMod> upList=stu.selectUserPart();
		// request.setAttribute("upList", upList);
		 return mapping.findForward("succ");
		
		}catch(Exception e)
		
		{
			e.printStackTrace();
			return mapping.findForward("failure");
		}
	}
	
	
	
	

}
